package com.qf.feign;


import com.qf.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author sunyamei
 * @version V1.0
 * @Project javase2203
 * @Package com.qf.feign
 * @Description:
 * @Date 2022/8/11 10:04
 *
 * 远程调用接口
 */
//指定被调用方服务名称
// fallback指定兜底方法实现类的实例
@FeignClient(value = "QF-SEARCH", fallback = SearchFeignFallBack.class)
@RequestMapping("/search")
public interface SearchFeign {

    @RequestMapping("/test1")
    public String test();

    /**
     * 测试post方式提交, 这样接收参数
     * @param user
     * @return
     */
    @RequestMapping("/insert")
    public String insertUser( User user);

    /**
     * 测试使用restful方式提交参数
     * @return
     */
    @RequestMapping("/findByName/{name}")
    public String findByName(@PathVariable(value = "name") String name);
}